<template>
	<!-- 轮播图 -->
	<view class="" >
	
	<view class="" style="position: relative;top: -20rpx;">
		<carousel :img-list="swiperList" url-key="image" @selected="selectedBanner"/>
	</view>
	
	
	
	<!-- 	<swiper style="position: relative;top: -30rpx;" class="card-swiper" :class="dotStyle?'square-dot':'round-dot'" :indicator-dots="true" :circular="true"
		 :autoplay="true" interval="100000" duration="500" @change="cardSwiper" indicator-color="#8799a3"
		 indicator-active-color="#0081ff">
			<swiper-item v-for="(item,index) in swiperList" :key="index" :class="cardCur==index?'cur':''">
				<view class="swiper-item">
					<image :src="item.image" mode="aspectFill" ></image>
				</view>
			</swiper-item>
		</swiper> -->
	</view>
</template>

<script>
	import carousel from '@/components/vear-carousel/vear-carousel'
	export default {
		components:{
			carousel
		},
		props:{
			swiperList:{
				type:Array,
				default:()=>[]
			}
		},
		data(){
			return {
				cardCur:0,
				dotStyle: false,
				
			}
		},
		methods:{
			selectedBanner(e){
				if(e.type == 0){
					// 本程序页面跳转
					uni.navigateTo({
						url:e.url
					})
					uni.switchTab({
						url:e.url
					})
				}else if(e.type == 1){
					console.log(e.type)
					// 第三方程序跳转
					 wx.navigateToMiniProgram({
					        appId: e.appid,  //appid
					        path: e.path,//path
					        // extraData: {  //参数
					        //   
					        // },
					        envVersion: 'release', //开发版develop 开发版 trial   体验版 release 正式版 
					        success(res) {
							  console.log(res)
					          console.log('成功')
					          // 打开成功
					        }
					      })
				}
				// console.log(e)
			},
			DotStyle(e) {
				this.dotStyle = e.detail.value
			},
			cardSwiper(e) {
				this.cardCur = e.detail.current
			},
		}
	}
</script>

<style>
	.tower-swiper .tower-item {
		transform: scale(calc(0.5 + var(--index) / 10));
		margin-left: calc(var(--left) * 100upx - 150upx);
		z-index: var(--index);
	}
</style>
